/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gennajavainstaller;

import java.awt.Component;

import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JProgressBar;

import javax.swing.SwingWorker;

/**
 *
 * @author GiulioGenna
 */
public class InstallationTask extends SwingWorker<Process, InputStream> {
    private Utils e;
    private Component parent;
    InstallationTask(Utils e, Component parent){
        this.e=e;
        this.parent=parent;
    }

  

    @Override
    protected Process doInBackground() throws InterruptedException{
        if(!this.isCancelled())
         e.eseguiExe();
       return e.process;
    }
    
    @Override
protected void done() {
       int n=0;
       JProgressBar bar = (JProgressBar) parent;
       /*while(Exe.exec!=null && n<100){
       bar.setValue(n);
       n++;
       }*/
    }
    
}
